<script setup lang="ts">
import { useTestStore } from '@/stores/test'

const count = ref(0)
const router = useRouter()
const Counter = useTestStore()
const loginOut = () => {
  Counter.zero()
  localStorage.setItem('app-token', '')
  router.push('/login')
}
const doGo = () => {
  Counter.inc()
  count.value++
}
</script>

<template>
  <div style="text-align: center">
    me count: {{ count }} | 状态: {{ Counter.count }}
    <button type="button" @click="doGo">[点击计数]</button>
  </div>
  <p style="text-align: center; padding: 20px 0">
    {{ $t('about') }}&nbsp;|&nbsp;<button @click="loginOut">点击退出</button>
  </p>
</template>

<style scoped lang="scss"></style>

<route>
{
  meta: {
    requiresAuth: true
  }
}
</route>
